package com.lyf.boot.modules.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lyf.boot.base.system.entity.SysUserRole;
import com.lyf.boot.modules.system.entity.vo.SysUserRoleVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Luyufan
 * @date 2023/8/14 16:33
 */
@Repository
public interface SysUserRoleDao extends BaseMapper<SysUserRole> {

    /**
     * 批量插入
     *
     * @param userRoles
     * @return int
     * @author Luyufan
     * @date 2023/8/14 18:28
     */
    int batchInsert(@Param("userRoles") List<SysUserRole> userRoles);

    /**
     * 根据用户id查询用户的角色
     *
     * @param userIds
     * @return List<SysUserRoleVo>
     * @author Luyufan
     * @date 2023/8/16 11:28
     */
    List<SysUserRoleVo> selectSysUserRoleByUserIds(@Param("userIds") List<Long> userIds);
}
